package ga.mutation;

import ga.GARun;
import ga.individuals.Individual;

import java.util.Collection;

public class NotUniform implements MutationMethod {
	private Double c;

	public NotUniform(Double c) {
		if (c < 0.0 || c > 1.0) {
			this.c = 0.5;
		} else {
			this.c = c;
		}
	}
	
	public NotUniform() {
		this(0.99);
	}
	
	@Override
	public Collection<Individual> method(Collection<Individual> individuals) {
		GARun.mutationProb *= this.c;
		MutationMethod method = new ClassicMutation();
		return method.method(individuals);
	}
	

}
